<template>
    <div class="wrapper main_wrap" ref="main">
        <page_header :content="content"></page_header>

        <div class="main_content">
            <div class="list_item">
                <p class="title">活动名称</p>
                <p class="info">{{info.name}}</p>
            </div>
            <div class="list_item">
                <p class="title">活动时间</p>
                <p class="info">{{to_date(info.stime,info.etime)}}</p>
            </div>
            <div class="list_item">
                <p class="title">活动价格</p>
                <p class="info">{{to_yuan(info.money)}}</p>
            </div>

            <div class="list_item">
                <p class="title">活动地址</p>
                <p class="info">{{info.address}}</p>
            </div>
            <div class="list_item">
                <p class="title">活动描述</p>
                <p class="info">{{info.describe}}</p>
            </div>
            <div class="list_item">
                <p class="title">联系电话</p>
                <p class="info">{{info.tel}}</p>
            </div>

        </div>
    </div>
</template>

<script>
    import page_header from "../../components/page_header";
    import pagination from "../../components/pagination";
    import _time from "../../utils/_time";
    import _float from "../../utils/_float";
    import api_activity from "../../api/api_activity";
    import _url from "../../utils/_url";

    export default {
        components: {
            page_header,
            pagination
        },
        data() {
            return {
                content: '活动详情',
                info: {}
            }
        },
        created() {
            let id = _url.getParam('id')
            api_activity.info(id, this.init_info)
        },
        methods: {
            init_info(data) {
                console.log(data)
              this.info = data
            },
            // 转换金额

            to_yuan(v) {
                return _float.to_fixed(v / 100)
            },
            to_fen(v) {
                return parseInt(v * 100)
            },
            to_date(stime,etime) {
                return  _time._to_month_date(stime,etime)
            },
        }
    }
</script>

<style scoped lang="less">
    .main_content {
        width: 100%;
        padding: 30px 10px 20px 10px;
        box-sizing: border-box;
        height: calc(100% - 50px);
        overflow-y: auto;
        overflow-x: hidden;
        background: #fdfdfd;
        .list_item{
            margin-bottom: 12px;
            display: flex;
            p{
                font-size: 15px;
            }
            .title{
                width: 90px;
                text-align: left;
                color: #9e9e9e;
                margin-bottom: 6px;
            }
            .info{
                flex: 1;
                color: #222222;

            }

        }
    }

</style>
